﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using System.Drawing;
using Styx.Logic.Pathing;
using Styx.WoWInternals.WoWObjects;
using Styx.Helpers;
using Styx.Logic.Combat;

namespace Druidhealz
{
    public partial class Druidhealz
    {
        //Logging
        private void Log(string format)
        {
            Logging.Write(Color.LightGreen, "[" + DateTime.Now.ToString("hh:mm:ss") + "][Druidhealz] " + format);
        }
        //Debug Logging
        private void dLog(string format)
        {
            Logging.WriteDebug(Color.LightGreen, "[" + DateTime.Now.ToString("hh:mm:ss") + "][Druidhealz] " + format);
        }

        //Moves to the location of a player
        private bool MoveTo(WoWUnit u)
        {
            if (u != null && !Me.IsMoving && u.Distance > 20)
            {
                Navigator.MoveTo(NextTo(u));
                return true;
            }
            else
            {
                return false;
            }
        }

        private bool C(string spell, WoWUnit target) //Cast spell on target
        {
            if (SpellManager.Cast(spell, target))
            {
                Log("casting " + spell + " " + target);
                lastCast = target;
                return true;
            }
            else
            {
                return false;
            }
        }
        private bool C(string spell) //Cast spell on Me
        {
            Log("selfcasting " + spell);
            lastCast = null;
            return SpellManager.Cast(spell);
        }
    }
}
